package com.googlecode.sere.connectors.httpcomponents

import org.apache.http.{HttpResponse, HttpRequest}
import com.googlecode.sere.http.RestEngine
import org.apache.http.protocol.{HttpContext, HttpRequestHandler}
import com.googlecode.sere.util.Logging

class SereHttpComponentsHandler extends HttpRequestHandler with Logging {

  def handle(req: HttpRequest, res: HttpResponse, context: HttpContext) {
    //logger.info("Received request from {}", req.getRequestLine.getRemoteAddr)
    val request = new HttpCoreRequest(req)
    val response = new HttpCoreResponse(res)
    RestEngine.process(request, response)
  }
}

